$(function () {
    var d = new Date()
    $(".spin-init").TouchSpin({
        min: 0,
        initval: 0,
        decimals: 2, //精度，
        boostat: 5,
        max: 1000000000
    });

    $(".spin-init-int").TouchSpin({
        min: 0,
        initval: 0,
        boostat: 5,
        max: 1000000000
    });

    $(".spin-referee").TouchSpin({
        min: 1,
        initval: 0,
        max: 5
    });

    $(".spin-ini").TouchSpin({
        min: 0,
        initval: 0,
        boostat: 5,
        max: 20
    });

    $(".spin-init-year").TouchSpin({
        initval: d.getFullYear(),
        max: 1000000000
    });
    $(".spin-credit-score").TouchSpin({
        initval: 80,
        min: 0,
        max: 100
    });

    jQuery.fn.dataTableExt.oSort["sortNumber-desc"] = function (a, b) {
        return ((a < b) ? 1 : ((a > b) ? -1 : 0));
    };

    jQuery.fn.dataTableExt.oSort["sortNumber-asc"] = function (a, b) {
        return ((a < b) ? -1 : ((a > b) ? 1 : 0));
    }

    $('#sort-table').DataTable({
        "paging": true,
        "aoColumnDefs": [{
            "sType": "sortNumber",
            "bSortable": true,
            "aTargets": [1]
        }],
        "order": [[ 1, "desc" ]],
        "language": {
            "sProcessing": "处理中...",
            "sLengthMenu": "显示 _MENU_ 项结果",
            "sZeroRecords": "没有匹配结果",
            "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
            "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
            "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
            "sInfoPostFix": "",
            "sSearch": "搜索:",
            "sUrl": "",
            "sEmptyTable": "表中数据为空",
            "sLoadingRecords": "载入中...",
            "sInfoThousands": ",",
            "oPaginate": {
                "sFirst": "首页",
                "sPrevious": "上页",
                "sNext": "下页",
                "sLast": "末页"
            },
            "oAria": {
                "sSortAscending": ": 以升序排列此列",
                "sSortDescending": ": 以降序排列此列"
            }
        }
    });
})